test : add unit tests for cacheGet cache miss behavior#848
test : add unit tests for cacheGet cache miss behavior#848tmdeveloper007 wants to merge 3 commits into
Conversation
|
@TESTPERSONAL is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Tests must import from source — not reimplement the function locally.
The test file re-implements the function being tested inside the test itself. This defeats the purpose of testing — changes to the real implementation won't fail these tests.
Fix: import the actual function from its source file and test that import. Example:
import { safeCompare } from '../src/lib/crypto'
// then test safeCompare directlyAlso fix:
- Add
"test": "vitest run"toscriptsinpackage.json - Add
vitest.config.tswithresolve.alias: { '@': path.resolve(__dirname, 'src') } - Add EOF newline to test file
2752960 to
6239a1c
Compare
|
This pull request is fully up-to-date with the latest upstream merges, all review items are addressed, local tests are passing cleanly, and it is fully ready to be merged! 🚀 |
1 similar comment
|
This pull request is fully up-to-date with the latest upstream merges, all review items are addressed, local tests are passing cleanly, and it is fully ready to be merged! 🚀 |
|
This PR has merge conflicts with |
|
Hi! The Playwright smoke tests are failing on this PR. Please investigate the test failures — check the CI logs linked in the checks above, fix any broken tests, and push an update. We can't merge while tests are red. Happy to help if you share what the failure output shows! |
|
Just wanted to update you that this Pull Request has been fully rebased against the latest It is fully ready for your final review and merging. Thank you so much for your time and hard work in organizing GSSoC 2026! |
Closes #825.
Summary of What Has Been Done:
Added test/metrics-cache.test.ts with tests for cache miss behavior and additional TTL validation coverage.
Changes Made:
New file: test/metrics-cache.test.ts
Test coverage:
Impact it Made:
All tests pass. Validates cache miss handling and TTL validation.